home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
util
/
dir
/
managers.lha
/
Managers
/
Dir
/
dir.gfxcon
< prev
next >
Wrap
Text File
|
1997-01-15
|
6KB
|
282 lines
G4C
; dir.gfxcon - by dck January 1997
; A GUI for the great picture format converter :
; GfxCon V1.7 © Dirk Farin / farindk@trick.informatik.uni-stuttgart.de
; (Available on Aminet)
; Looks for GFXcon under the name contained in variable $DEF.GFXCON
WinBig -1 -1 200 166 "GfxCon V1.7"
WinType 11110001
xOnLoad
setscreen dir.gfxcon $lv_fmscreen
ifexists file $DEF.GFXCON ; you MUST have configured dir.gc
; You're my kind of guy..
else
EZReq "GFXcon not found!\nPlease configure\nDir.gc correctly." "OK" ""
guiquit dir.gfxcon
stop
endif
gfx_format = ILBM ; our variables
gfx_colors = ""
gfx_bw = ""
gfx_flip = ""
gfx_rot = ""
gfx_x = 320
gfx_y = 250
gfx_size = ""
gfx_file = ""
gfx_mode = FILES
gosub dir.gfxcon FileMode
guiopen dir.gfxcon
xOnClose
delvar gfx_#?
guiquit dir.gfxcon
xRoutine FileMode
setgad dir.gfxcon 1 HIDE
setgad dir.gfxcon 2 HIDE
setgad dir.gfxcon 3 HIDE
setgad dir.gfxcon 4 HIDE
setgad dir.gfxcon 5 HIDE
setgad dir.gfxcon 6 HIDE
setgad dir.gfxcon 7 HIDE
setgad dir.gfxcon 8 HIDE
setgad dir.gfxcon 9 HIDE
setgad dir.gfxcon 10 HIDE
setgad dir.gfxcon 11 HIDE
setgad dir.gfxcon 12 HIDE
setgad dir.gfxcon 21 SHOW
setgad dir.gfxcon 22 SHOW
setgad dir.gfxcon 23 SHOW
setgad dir.gfxcon 24 SHOW
setgad dir.gfxcon 25 SHOW
redraw dir.gfxcon
xRoutine ConvertMode
setgad dir.gfxcon 1 SHOW
setgad dir.gfxcon 2 SHOW
setgad dir.gfxcon 3 SHOW
setgad dir.gfxcon 4 SHOW
setgad dir.gfxcon 5 SHOW
setgad dir.gfxcon 6 SHOW
setgad dir.gfxcon 7 SHOW
setgad dir.gfxcon 8 SHOW
setgad dir.gfxcon 9 SHOW
setgad dir.gfxcon 10 SHOW
setgad dir.gfxcon 11 SHOW
setgad dir.gfxcon 12 SHOW
setgad dir.gfxcon 21 HIDE
setgad dir.gfxcon 22 HIDE
setgad dir.gfxcon 23 HIDE
setgad dir.gfxcon 24 HIDE
setgad dir.gfxcon 25 HIDE
redraw dir.gfxcon
xCycler 0 0 200 14 "" gfx_mode
cstr "Choose/Add Files" FILES
Cstr "Converting Options" CONVERT
if $gfx_mode = CONVERT
gosub dir.gfxcon ConvertMode
else
gosub dir.gfxcon FileMode
endif
;------------------------------- PRETTY OBVIOUS OPTIONS GADGETS
xCycler 70 15 125 14 Format gfx_format
GadID 1
cstr ILBM ILBM
cstr GIF GIF
cstr JPEG JPEG
cstr PCX PCX
cstr PostScript Postscript
cstr RGB-Raw RGB-Raw
xCycler 70 30 125 14 Colors gfx_colors
GadId 2
cstr Default ""
cstr 16 16
cstr 32 32
cstr 128 128
cstr 256 256
cstr 2 2
cstr 4 4
cstr 8 8
xCycler 70 45 125 14 Type gfx_bw
GadId 3
cstr Default ""
cstr GRAYSCALE GRAYSCALE
cstr BW BW
cstr INVERT INVERS
cstr "NO Red" NORED
cstr "NO Green" NOGREEN
cstr "NO Blue" NOBLUE
xCycler 70 60 125 14 Flip gfx_flip
gadid 11
Cstr None ""
cstr "Flip X" FLIPX
cstr "Filp Y" FLIPY
cstr "Flip XY" "FLIPX FLIPY"
xcycler 70 75 125 14 Rotate gfx_rot
gadid 12
cstr None ""
cstr "90 Left" ROTATELEFT
cstr "90 Right" ROTATERIGHT
; NOT IMPLEMENTED YET
; slider contrast CONTRAST 0-100
; slider brightness BRIGHTNESS 0-255
;---- Size
xCycler 70 90 125 14 Size gfx_size
gadid 4
cstr Same ""
cstr BOXFIT BOXFIT
cstr SIZE SIZE
if $gfx_size = NONE
setgad dir.gfxcon 5 OFF
setgad dir.gfxcon 6 OFF
else
setgad dir.gfxcon 5 ON
setgad dir.gfxcon 6 ON
endif
; -- Size textin gadgets
xTEXTIN 70 105 60 18 "" gfx_x 320 10
gadid 5
SetGad dir.gfxcon 6 ON
xTEXTIN 135 105 60 18 "" gfx_y 250 10
gadid 6
; -------------------- Status Boxes
TEXT 5 125 40 10 "Status:" 20 NOBOX
gadid 7
TEXT 5 135 190 14 "No Files" 130 BOX
GadID 8
;--------------------- LISTVIEW SHOWING FILES TO CONVERT
xListView 0 15 200 135 "" gfx_file "" 10 MULTI
gadid 21
xbutton 0 150 50 14 View
gadid 25
lvmulti dir.gfxcon 21 first
while $gfx_file > ""
FILENAME = $gfx_file
gosub dir.view ViewFile
lvmulti dir.gfxcon 21 next
endwhile
xButton 50 150 50 14 Add ; add files selected from dir.gc
gadid 22
lvmulti dir.gc $$LV_ID first
while $lv_file > ""
lvadd dir.gfxcon 21 $lv_file
lvmulti dir.gc $$LV_ID off
lvmulti dir.gc $$LV_ID next
endwhile
xButton 100 150 50 14 Del ; delete selected files
gadid 23
lvmulti dir.gfxcon 21 first
while $gfx_file > ""
lvdel dir.gfxcon 21 -1
lvmulti dir.gfxcon 21 next
endwhile
xButton 150 150 50 14 Clr
gadid 24
lvclear dir.gfxcon 21
;-------------------- Cancel the relaunch of gfxcon
xButton 100 150 95 14 CANCEL
gadfont topaz.font 8 010
gadid 9
gfx_flag = 1
;-------------------- This is where we do our stuff!
xBUTTON 5 150 95 14 "Convert"
gadid 10
gadfont topaz.font 8 010
gfx_flag = 0
lvget dir.gfxcon 21 0 gfx_cfile
if $gfx_cfile > ""
lvdel dir.gfxcon 21 0
update dir.gfxcon 7 Converting:
update dir.gfxcon 8 $gfx_cfile
gosub dir.gfxcon makecom
setstack 20000
Launch 1 '$DEF.GFXCON >NIL: $gfx_cfile $gfx_com NOPROGRESS'
setstack 4000
endif
; This is where the Launch command will return to when the program
; it has run has finished executing. We then tell it to do it again
xOnReturn 1
update dir.gfxcon 7 Status:
update dir.gfxcon 8 Finished
if $gfx_flag = 1
stop
endif
lvget dir.gfxcon 21 0 gfx_cfile
if $gfx_cfile > ""
lvdel dir.gfxcon 21 0
update dir.gfxcon 7 Converting:
update dir.gfxcon 8 $gfx_cfile
gosub dir.gfxcon makecom
setstack 20000
Launch 1 '$DEF.GFXCON >NIL: $gfx_cfile $gfx_com NOPROGRESS'
setstack 4000
endif
; ------------ Routine to form command line
xroutine makecom
gfx_com = 'FORMAT $gfx_format'
if $gfx_colors > ""
appvar gfx_com ' COLORS $gfx_colors'
endif
if $gfx_bw > ""
appvar gfx_com ' $gfx_bw'
endif
if $gfx_flip > ""
appvar gfx_com ' $gfx_flip'
endif
if $gfx_rot > ""
appvar gfx_com ' $gfx_rot'
endif
if $gfx_size > ""
appvar gfx_com ' $gfx_size $gfx_x $gfx_y'
endif
; --------------
; This is where we'll end up if anything goes wrong..
; i.e. such as GFXcon not finding the file and returning an error status
xOnFail
EZReq "An error occured.\nClick on Convert to continue." "OK" ""